//
//  YHYAddCVButtonTableViewCell.m
//  Home
//
//  Created by 杨泓晔 on 16/5/18.
//  Copyright © 2016年 LanJue. All rights reserved.
//

#import "YHYAddCVButtonTableViewCell.h"

@implementation YHYAddCVButtonTableViewCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
        self.contentView.backgroundColor = LV;
    }
    
    return self;
}

- (void)createSubView{
    _lookButton = [UIButton new];
    [self.contentView addSubview:_lookButton];
    [_lookButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(40 * AUTO_HEIGHT);
        make.left.mas_equalTo(10 * AUTO_WIDTH);
        make.width.mas_equalTo((SCREEN_WIDTH - 30 * AUTO_WIDTH - 40)/2 *AUTO_WIDTH);
        make.bottom.mas_equalTo(0 * AUTO_HEIGHT);
       
    }];
    _lookButton.backgroundColor = GH;
    _lookButton.layer.masksToBounds = YES;
    self.lookButton.layer.cornerRadius = 5;
    _lookButton.tag = 1000;
    [self.lookButton setTitle:@"预览" forState:UIControlStateNormal];
    [self.lookButton addTarget:self action:@selector(lookButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.lookButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    // [self.button setTitleColor:HS forState:UIControlStateNormal];
//    self.button.frame = CGRectMake(44.00/2*AUTO_WIDTH,470*AUTO_WIDTH, self.view.frame.size.width -88/2*AUTO_WIDTH, 40.00*AUTO_WIDTH);
    self.lookButton.titleLabel.font = [UIFont fontWithName:@"Arial" size:LOGINFONT * TEXTWEIGHT];
   
    
    
    
    
    
    _saveButton = [UIButton new];
    [self.contentView addSubview:_saveButton];
    [_saveButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.top.width.mas_equalTo(_lookButton);
        make.left.mas_equalTo(_lookButton.mas_right).offset(15 * AUTO_WIDTH);
        
        
    }];
    _saveButton.tag = 1001;
    _saveButton.backgroundColor = GH;
    _saveButton.layer.masksToBounds = YES;
    self.saveButton.layer.cornerRadius = 5;
    [self.saveButton setTitle:@"保存" forState:UIControlStateNormal];
    [self.saveButton addTarget:self action:@selector(lookButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    // [self.button setTitleColor:HS forState:UIControlStateNormal];
    //    self.button.frame = CGRectMake(44.00/2*AUTO_WIDTH,470*AUTO_WIDTH, self.view.frame.size.width -88/2*AUTO_WIDTH, 40.00*AUTO_WIDTH);
    self.saveButton.titleLabel.font = [UIFont fontWithName:@"Arial" size:LOGINFONT * TEXTWEIGHT];


}

- (void)lookButton:(UIButton *)btu{
    if (btu.tag == 1000) {
        [self.delegate presentDelegate:btu.tag];
    }
    if (btu.tag == 1001) {
        [self.delegate presentDelegate:btu.tag];
    }
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
